<?php
/*
 * @package Webhosting Component
 * @copyright Copyright (C) 2007 Jonas Brand. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * Official website: http://wh-com.de
 */

/*
* Sicherstellen, dass das Script nicht direkt aufgerufen wird
*/
defined( '_VALID_MOS' ) or die('Direct Access to this acript is not allowrd');

class HTML_webhosting {
function listCats($option,&$rows) {
    $number = count($rows);
    $echo= '
		<table class="adminheading">
		<tr>
			<th>'.LANG_FEATURECATS.'</th>
		</tr>
		</table>
    <form action="index2.php" method="post" name="adminForm">
    <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
    <tr>
        <th width="20">
         <input type="checkbox" name="toggle" value="" onclick="checkAll('.$number.');"/>
        </th>
        <th align="left">'.LANG_NAME.'</th>
        <th align="center" width="60%">'.LANG_REORDER.'</th>
    <tr>';
    $i=0;
    if( $rows )
    foreach($rows as $row) {
        $evenodd=$i%2;
        $echo .= '
    <tr class="row'.$evenodd.'">
        <td>
            <input type="checkbox" id="cb'.$i.'" name="cid[]" value="'.$row->id.'" onclick="isChecked(this.checked);" />
        </td>
        <td>
            <a href="index2.php?option='.$option.'&task=editCat&id='.$row->id.'">
            '.$row->name.'
            </a>
        </td>
        <td align="center">
            <a href="#reorder" onclick="return listItemTask(\'cb'.$i.'\',\'orderCatsUp\')" title="'.LANG_ORDERUP.'">
              <img src="./images/uparrow.png" border=0>
            </a>
            <a href="#reorder" onclick="return listItemTask(\'cb'.$i.'\',\'orderCatsDown\')" title="'.LANG_ORDERDOWN.'">
              <img src="./images/downarrow.png" border=0>
            </a>
        </td>
    </tr>';
    $i++;
    }
    $echo .= '
    </table>
    <input type="hidden" name="option" value="'.$option.'" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="boxchecked" value="0" />
    </form>';
    echo $echo;
}

function editCat( &$row, $option ) {
    $echo='
		<script language="javascript" type="text/javascript">
		<!--
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == \'cancelCat\') {
				submitform( pressbutton );
				return;
			}

			// do field validation
			if ( form.name.value == \'\' ) {
				alert( \''.LANG_NOT_ALL_FIELDS.' (name)\' );
			} else {
				submitform( pressbutton );
			}
		}
		//-->
		</script>

		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th>
			'.LANG_FEATURECAT.':
			<small>
            '.($row->id ? LANG_EDIT : LANG_ADD).'
			</small>
			</th>
		</tr>
		</table>

		<table width="100%">
		<tr>
			<td width="60%" valign="top">
				<table width="100%" class="adminform">
				<tr>
					<td width="20%" align="right">
					'.LANG_NAME.':
					</td>
                    <td>
                    <input class="inputbox" type="text" name="name" size="50" maxlength="100" value="'.$row->name.'" />
                    </td>
				</tr>
                </table>
            </td>
        </tr>
        </table>
        <input type="hidden" name="option" value="'.$option.'" />
        <input type="hidden" name="id" value="'.$row->id.'" />
        <input type="hidden" name="ordering" value="'.$row->ordering.'" />
        <input type="hidden" name="task" value="saveCat" />
        </form>';
    echo $echo;
}

function showConfig( $option, &$params, $id ) {
    global $mosConfig_live_site;
    $echo='
    <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
    <form action="index2.php" method="post" name="adminForm">
    <table class="adminheading">
    <tr>
        <th>
        '.LANG_CONFIG.'
        </th>
    </tr>

    <table class="adminform">
    <tr>
        <td>
        '.$params->render().'
        </td>
    </tr>
    </table>

	<input type="hidden" name="id" value="'.$id.'" />
	<input type="hidden" name="name" value="Webhosting" />
	<input type="hidden" name="admin_menu_link" value="option=com_webhosting" />
	<input type="hidden" name="admin_menu_alt" value="Webhosting" />
	<input type="hidden" name="option" value="com_webhosting" />
	<input type="hidden" name="admin_menu_img" value="js/ThemeOffice/component.png" />
	<input type="hidden" name="option" value="'.$option.'" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
    </form>
    <script language="Javascript" src="'.$mosConfig_live_site.'/includes/js/overlib_mini.js"></script>';
    echo $echo;
}

function listFeatures($option,&$rows) {
    $number = count($rows);
    $echo ='
		<table class="adminheading">
		<tr>
			<th>
			'.LANG_FEATURES.'
			</th>
		</tr>
		</table>
    <form action="index2.php" method="post" name="adminForm">
    <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
    <tr>
        <th width="20">
         <input type="checkbox" name="toggle" value="" onclick="checkAll('.count($rows).');"/>
        </th>
        <th align="left">'.LANG_NAME.'</th>
        <th align="center" width="20%">'.LANG_FEATURECAT.'</th>
        <th align="center" width="20%">'.LANG_STANDARD.'</th>
        <th align="center" width="20%">'.LANG_REORDER.'</th>
    <tr>';
    $i=0;
    if( $rows )
    foreach($rows as $row) {
        $evenodd=$i%2;
        if($row->standard==1) $img="tick.png";
        else $img="publish_x.png";
    $echo .='
    <tr class="row'.$evenodd.'">
        <td>
            <input type="checkbox" id="cb'.$i.'" name="cid[]" value="'.$row->id.'" onclick="isChecked(this.checked);" />
        </td>
        <td>
            <a href="index2.php?option='.$option.'&task=editFeature&hidemainmenu=1&id='.$row->id.'">
            '.$row->name.'
            </a>
        </td>
        <td align="center">
            '.$row->catname.'
        </td>
        <td align="center">
            <a href="#standard" onclick="return listItemTask(\'cb'.$i.'\',\'standardFeature\')" title="Standard">
             <img src="./images/'.$img.'" border=0>
            </a>
        </td>
        <td align="center">
            <a href="#reorder" onclick="return listItemTask(\'cb'.$i.'\',\'orderFeaturesUp\')" title="Move Up">
              <img src="./images/uparrow.png" border=0>
            </a>
            <a href="#reorder" onclick="return listItemTask(\'cb'.$i.'\',\'orderFeaturesDown\')" title="Move Down">
              <img src="./images/downarrow.png" border=0>
            </a>
        </td>
    </tr>';
    $i++;
    }
    $echo .='
    </table>
    <input type="hidden" name="option" value="'.$option.'" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="boxchecked" value="0" />
    </form>';
    echo $echo;
    }

function editFeature( &$row, &$cats, $option ) {
    $catlist = '<select name="cat" size="1">';
    foreach($cats as $cat) {
        if($row->cat==$cat->id) {
            $selected=' selected';
        }
        else {
            $selected='';
        }
        $catlist .= '<option value="'.$cat->id.'"'.$selected.'>'.$cat->name.'</option>';
        $selected="";
    }
    $catlist .= '\n</select>';

	$modus=
    $echo='
		<script language="javascript" type="text/javascript">
		<!--
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == \'cancelFeature\') {
				submitform( pressbutton );
				return;
			}

			// do field validation
			if ( form.name.value == \'\' ) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_NAME.'\' );
		    } else if ( form.value.value == \'\' ) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_VALUE.'\' );
		    } else if ( form.title.value == \'\' ) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_TITLE.'\' );
            } else {
				submitform( pressbutton );
			}
		}
		//-->
		</script>

		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th>
			'.LANG_FEATURE.':
			<small>
            '.($row->id ? LANG_EDIT : LANG_ADD).'
			</small>
			</th>
		</tr>
		</table>

		<table width="100%">
		<tr>
			<td width="60%" valign="top">
				<table width="100%" class="adminform">
				<tr>
					<td width="20%" align="right">
					'.LANG_NAME.':
					</td>
                    <td width="40%">
                    <input class="inputbox" type="text" name="name" size="50" maxlength="100" value="'.$row->name.'" />
                    </td>
                    <td rowspan="4" width="40%">
                    '.LANG_VARHELP.'<br/>
                    <table>
                        <tr><td>[name]</td><td>'.LANG_VARHELP_NAME.'</td></tr>
                        <tr><td>[description]</td><td>'.LANG_VARHELP_DESCRIPTION.'</td></tr>
                        <tr><td>[webspace] '.LANG_VARHELP_OR.' [webspace-mb]</td><td>'.LANG_VARHELP_WEBSPACE.'</td></tr>
                        <tr><td>[webspace-gb]</td><td>'.LANG_VARHELP_WEBSPACE_GB.'</td></tr>
                        <tr><td>[traffic] '.LANG_VARHELP_OR.' [traffic-mb]</td><td>'.LANG_VARHELP_TRAFFIC.'</td></tr>
                        <tr><td>[traffic-gb]</td><td>'.LANG_VARHELP_TRAFFIC_GB.'</td></tr>
                        <tr><td>[mailaccounts]</td><td>'.LANG_VARHELP_MAILACCOUNTS.'</td></tr>
                        <tr><td>[aliases]</td><td>'.LANG_VARHELP_ALIASES.'</td></tr>
                        <tr><td>[subdomains]</td><td>'.LANG_VARHELP_SUBDOMAINS.'</td></tr>
                        <tr><td>[ftpaccounts]</td><td>'.LANG_VARHELP_FTPACCOUNTS.'</td></tr>
                        <tr><td>[php]</td><td>'.LANG_VARHELP_PHP.'</td></tr>
                        <tr><td>[cgi-perl]</td><td>'.LANG_VARHELP_CGI_PERL.'</td></tr>
                        <tr><td>[dbaccounts]</td><td>'.LANG_VARHELP_DBACCOUNTS.'</td></tr>
                        <tr><td>[dbusers]</td><td>'.LANG_VARHELP_DBUSERS.'</td></tr>
                        <tr><td>[price]</td><td>'.LANG_VARHELP_PRICE.'</td></tr>
                        <tr><td>[price-x6]</td><td>'.LANG_VARHELP_PRICE_X6.'</td></tr>
                        <tr><td>[price-x12]</td><td>'.LANG_VARHELP_PRICE_X12.'</td></tr>
                        <tr><td>[setupfee]</td><td>'.LANG_VARHELP_SETUPFEE.'</td></tr>
                        <tr><td>[billing_cycle]</td><td>'.LANG_VARHELP_BILLING_CYCLE.'</td></tr>
                        <tr><td>[domains]</td><td>'.LANG_VARHELP_DOMAINS.'</td></tr>
                        <tr><td>[tlds]</td><td>'.LANG_VARHELP_TLDS.'</td></tr>
                    </table>
                    </td>
				</tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_FEATURECAT.':
                    </td>
                    <td>
                    '.$catlist.'
                    </td>
                </tr>
				<tr>
					<td width="20%" align="right">
					'.LANG_TITLE.':
					</td>
                    <td>
                    <textarea class="textarea" name="title" rows="6" cols="50">'.$row->title.'</textarea>
                    </td>
				</tr>
				<tr>
					<td width="20%" align="right">
					'.LANG_VALUE.':
					</td>
                    <td>
                    <textarea class="textarea" name="value" rows="6" cols="50">'.$row->value.'</textarea>
                    </td>
				</tr>
                </table>
            </td>
        </tr>
        </table>
        <input type="hidden" name="option" value="'.$option.'" />
        <input type="hidden" name="id" value="'.$row->id.'" />
        <input type="hidden" name="ordering" value="'.$row->ordering.'" />
        <input type="hidden" name="task" value="saveFeature" />
        </form>';
    echo $echo;
}

function listPlans($option,&$rows) {
	global $mode;
    $echo = '
		<table class="adminheading">
		<tr>
			<th>
			'.LANG_PLANS.'
			</th>
		</tr>
		</table>
    <form action="index2.php" method="post" name="adminForm">
    <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
    <tr>
        <th width="20">
         <input type="checkbox" name="toggle" value="" onclick="checkAll('.count($rows).')"/>
        </th>
        <th align="left">'.LANG_NAME.'</th>';
    if($mode=='vhcs2') {
		$echo .= '
		<th align="center">'.LANG_VHCSID.'</th>';
	}
	$echo .= '
        <th align="left">'.LANG_CATEGORY.'</th>
        <th align="center">'.LANG_PUBLISHED.'</th>
        <th align="center">'.LANG_REORDER.'</th>
		<tr>';
    $i=0;
    if( $rows )
    foreach($rows as $row) {
        $echo .= '
    <tr class="row'.($i%2).'">
        <td>
            <input type="checkbox" id="cb'.$i.'" name="cid[]" value="'.$row->id.'" onclick="isChecked(this.checked);" />
        </td>
        <td>
            <a href="index2.php?option='.$option.'&task=editPlan&hidemainmenu=1&id='.$row->id.'">
            '.($row->name=='' ? LANG_NONAME : $row->name).'
            </a>
        </td>';
		if($mode=='vhcs2') {
			$echo .= '
		<td align="center">'.$row->id_vhcs.'</td>';
		}
        $echo .= '
        <td>
			<a href="index2.php?option=com_categories&section=com_webhosting&task=editA&hidemainmenu=1&id='.$row->catid.'">
			'.$row->cat.'
			</a>
		</td>
		<td align="center">
            <a href="#publish" onclick="return listItemTask(\'cb'.$i.'\',\'publishPlan\')" title="'.LANG_PUBLISH.'">
             <img src="./images/'.($row->published==1 ? 'tick.png' : 'publish_x.png').'" border=0>
            </a>
        </td>
        <td align="center">
            <a href="#reorder" onclick="return listItemTask(\'cb'.$i.'\',\'orderPlansUp\')" title="'.LANG_ORDERUP.'">
              <img src="./images/uparrow.png" border=0>
            </a>
            <a href="#reorder" onclick="return listItemTask(\'cb'.$i.'\',\'orderPlansDown\')" title="'.LANG_ORDERDOWN.'">
              <img src="./images/downarrow.png" border=0>
            </a>
        </td>
    </tr>';
    $i++;
    }
    $echo .= '
    </table>
    <input type="hidden" name="option" value="'.$option.'" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="boxchecked" value="0" />
    </form>';
    echo $echo;
}

function editPlan( &$row, &$row2, &$features, &$reseller, &$cats, $mode, $option ) {
    $featurelist = '<select name="features[]" id="features" size="20" multiple>';
    $featurearray=explode('-',$row->features);
    if(in_array('s',$featurearray)) $standard_selected=" selected";
    else $standard_selected='';
    if(in_array('*',$featurearray)) $all_selected=" selected";
    else $all_selected='';
    $featurelist.='<option value="s"'.$standard_selected.'>'.LANG_STANDARDFEATURES.'</option>';
    $featurelist.='<option value="*"'.$all_selected.'>'.LANG_ALLFEATURES.'</option>';
    $featurelist.='<option value="0">----------</option>';
    foreach($features as $feature) {
        if(in_array($feature->id,$featurearray)) {
            $selected=" selected";
        }
        else {
            $selected='';
        }
        $featurelist .= '<option value="'.$feature->id.'"'.$selected.'>'.$feature->name.'</option>';
        $selected="";
    }
    $featurelist .= '</select>';

    $shortfeaturelist = '<select name="features_short[]" id="features_short" size="20" multiple>';
    $featurearray=explode('-',$row->features_short);
    foreach($features as $feature) {
        if(in_array($feature->id,$featurearray)) {
            $selected=" selected";
        }
        $shortfeaturelist .= '<option value="'.$feature->id.'"'.$selected.'>'.$feature->name.'</option>';
        $selected="";
    }
    $shortfeaturelist .= '</select>';
    if($mode=="vhcs2") {
        $resellerlist = '<select name="reseller_id" size="1">';
        $resellerlist .= '<option value="0">---------</option>';
        foreach($reseller as $res) {
            if($row2->reseller_id==$res->admin_id) {
                $selected=" selected";
            }
            else {
                $selected="";
            }
            $resellerlist .= '<option value="'.$res->admin_id.'"'.$selected.'>'.$res->admin_name.'</option>';
        }
        $resellerlist .='</select>';
    }
    $tabs=new mosTabs(1);
	if(!$row->id) {
		$php='';
		$cgi_perl='';
		$subdomains=0;
		$aliases=0;
		$mailaccounts=0;
		$ftpaccounts=0;
		$dbaccounts=0;
		$dbusers=0;
		$traffic=0;
		$webspace=0;
		$leer='';
	}
	else {
		list($php,$cgi_perl,$subdomains,$aliases,$mailaccounts,$ftpaccounts,$dbaccounts,$dbusers,$traffic,$webspace,$leer)=explode(";", $row2->props);
    }
	$moshtml=new mosHTML();
    mosCommonHTML::loadOverlib();
    $php=$moshtml->yesnoRadioList('php','',$php=="_no_" ? '0' : '1');
    $cgi_perl=$moshtml->yesnoRadioList('cgi_perl','',$cgi_perl=="_no_" ? '0' : '1');

    $echo = '
		<script language="javascript" type="text/javascript">
		<!--
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == \'cancelPlan\') {
				submitform( pressbutton );
				return;
			}
			// do field validation
			if ( form.name.value == \'\' ) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_NAME.'\' )';
            if($mode=="vhcs2") {
            $echo .= '
            } else if ( form.id_vhcs.value == \'0\' && !form.newvhcs.checked) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_VHCSID.'\' );
            } else if ( form.id_vhcs.value == \'\' && !form.newvhcs.checked) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_VHCSID.'\' );
            } else if ( form.reseller_id.value == \'0\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_RESELLER.'\' );';
            }
            $echo .= '
            } else if (document.getElementById(\'features\').selectedIndex == -1 || document.getElementById(\'features\').options[2].selected) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_FEATURES.'\' );
            } else if (document.getElementById(\'features_short\').selectedIndex == -1) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_SHORTFEATURES.'\' );
			';
			$echo .= '
		    } else if ( form.domains.value == \'\' ) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_DOMAINNUMBER.'\' )
		    } else if ( form.tlds.value == \'\' ) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_TLDS.'\' );
		    } else if ( form.tldprices.value == \'\' ) {
				alert( \''.LANG_NOT_ALL_FIELDS.LANG_TLDPRICES.'\' );
            } else if (form.webspace.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_WEBSPACE.'\' );
            } else if (form.traffic.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_TRAFFIC.'\' );
             } else if (form.subdomains.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_SUBDOMAINS.'\' );
             } else if (form.ftpaccounts.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_FTP.'\' );
             } else if (form.mailaccounts.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_EMAIL.'\' );
             } else if (form.aliases.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_ALIASES.'\' );
             } else if (form.dbaccounts.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_MYSQLDB.'\' );
             } else if (form.dbusers.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_MYSQLUSER.'\' );
             } else if (form.price.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_PRICE.'\' );
             } else if (form.setup_fee.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_SETUPFEE.'\' );
              } else if (form.value.value == \'\' ) {
                alert( \''.LANG_NOT_ALL_FIELDS.LANG_CURRENCY.'\' );
              } else {
				submitform( pressbutton );
			}
		}
		//-->
		</script>

		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th>
			'.LANG_PLAN.':
			<small>
            '.($row->id ? LANG_EDIT : LANG_ADD).'
			</small>
			</th>
		</tr>
		</table>

		<table width="100%">
		<tr>
			<td width="60%" valign="top">';
    echo $echo;
    $tabs->startPane("plan-pane");
    $tabs->startTab(LANG_COMMONTAB,"common-tab");
    echo '
				<table width="100%" class="adminform">
				<tr>
					<td width="20%" align="right">
					'.LANG_NAME.':
					</td>
                    <td>
                    <input class="inputbox" type="text" name="name" size="50" maxlength="100" value="'.$row2->name.'" />
                    </td>
				</tr>
				<tr>
					<td width="20%" align="right">
					'.LANG_CATEGORY.'
					</td>
                    <td>
                    '.$cats.'
                    </td>
				</tr>
				';
    if($mode=="vhcs2") {
        if(!isset($row->id_vhcs) || $row->id_vhcs=='0') {
            $newvhcsentry=" checked";
            }
        echo '
				<tr>
					<td width="20%" align="right">
					'.LANG_VHCSID.':
					</td>
                    <td>
                    '.LANG_NEWENTRY.' <input type="checkbox" name="newvhcs" value="1"'.$newvhcsentry.'><br/>
                    '.LANG_OR.'<br/>
                    '.LANG_EXISTINGENTRY.' <input class="inputbox" type="text" name="id_vhcs" size="5" maxlength="5" value="'.$row->id_vhcs.'" />
                    </td>
				</tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_RESELLER.':
                    </td>
                    <td>
                    '.$resellerlist.'
                    </td>
                </tr>';
    }
    echo '
                <tr>
					<td width="20%" align="right">
					'.LANG_DESCRIPTION.':
					</td>
                    <td>';
	// parameters : areaname, content, hidden field, width, height, rows, cols
    editorArea( 'editor1', stripslashes($row2->description), 'description', '100%;', '300', '60', '20' ) ;
    echo '
                    </td>
				</tr>
                </table>';
    $tabs->endTab();
    $tabs->startTab(LANG_FEATURESTAB,"features-tab");
    echo '
				<table width="100%" class="adminform">
                <tr>
                    <td width="20%" align="right">
                    '.LANG_FEATURES.':
                    </td>
                    <td>
                    '.$featurelist.'
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_SHORTFEATURES.':
                    </td>
                    <td>
                    '.$shortfeaturelist.'
                    </td>
                </tr>
                </table>';
    $tabs->endTab();
    $tabs->startTab(LANG_PROPERTYTAB,"property-tab");
    echo '
				<table width="100%" class="adminform">
                <tr>
					<td width="20%" align="right">
					'.LANG_DOMAINNUMBER.':
					</td>
                    <td>
                    <input class="inputbox" type="text" name="domains" size="50" maxlength="100" value="'.$row->domains.'" />
                    </td>
				</tr>
                <tr>
					<td width="20%" align="right">
					'.LANG_TLDS.':<br/>
                    <i>'.LANG_TLDS_INFO.'</i>
					</td>
                    <td>
                    <input class="inputbox" type="text" name="tlds" size="50" maxlength="100" value="'.$row->tlds.'" />
                    </td>
				</tr>
                <tr>
					<td width="20%" align="right">
					'.LANG_TLDPRICES.':<br/>
                    <i>'.LANG_TLDPRICES_INFO.'</i>
					</td>
                    <td>
                    <input class="inputbox" type="text" name="tldprices" size="50" maxlength="100" value="'.$row->tldprices.'" />
                    </td>
				</tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_WEBSPACE.':<br/>
                    <i>'.LANG_WEBSPACE_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="webspace" size="50" maxlength="30" value="'.$webspace.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_TRAFFIC.'<br/>
                    <i>'.LANG_TRAFFIC_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="traffic" size="50" maxlength="30" value="'.$traffic.'" />
                    </td>
				<tr>
					<td width="20%" align="right">
					'.LANG_PHP.':
					</td>
                    <td>
                    '.$php.'
                    </td>
				</tr>
				<tr>
					<td width="20%" align="right">
					'.LANG_CGIPERL.':
					</td>
                    <td>
                    '.$cgi_perl.'
                    </td>
				</tr>
				<tr>
					<td width="20%" align="right">
					'.LANG_SUBDOMAINS.':<br/>
                    <i>'.LANG_SUBDOMAINS_INFO.'</i>
					</td>
                    <td>
                    <input class="inputbox" type="text" name="subdomains" size="5" maxlength="5" value="'.$subdomains.'" />
                    </td>
				</tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_FTP.':<br/>
                    <i>'.LANG_FTP_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="ftpaccounts" size="5" maxlength="5" value="'.$ftpaccounts.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_EMAIL.':<br/>
                    <i>'.LANG_EMAIL_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="mailaccounts" size="5" maxlength="5" value="'.$mailaccounts.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_ALIASES.':<br/>
                    <i>'.LANG_ALIASES_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="aliases" size="5" maxlength="5" value="'.$aliases.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_MYSQLDB.':<br/>
                    <i>'.LANG_MYSQLDB_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="dbaccounts" size="5" maxlength="5" value="'.$dbaccounts.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_MYSQLUSER.':<br/>
                    <i>'.LANG_MYSQLUSER_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="dbusers" size="5" maxlength="5" value="'.$dbusers.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_PRICE.':<br/>
                    <i>'.LANG_PRICE_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="price" size="5" maxlength="5" value="'.$row2->price.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_SETUPFEE.':<br/>
                    <i>'.LANG_SETUPFEE_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="setup_fee" size="5" maxlength="5" value="'.$row2->setup_fee.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_CURRENCY.':<br/>
                    <i>'.LANG_CURRENCY_INFO.'</i>
                    </td>
                    <td>
                    <input class="inputbox" type="text" name="value" size="50" maxlength="50" value="'.$row2->value.'" />
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right">
                    '.LANG_BILLING_CYCLE.':
                    </td>
                    <td>
                    <select name="payment">';
    $billing=$row2->payment;
    $selected[1]='';
    $selected[3]='';
    $selected[6]='';
    $selected[12]='';
    $selected[24]='';
    if($row2->payment) $selected[intval($billing)]=' selected';
    echo '
      			<option value="1"'.$selected[1].'>'.LANG_BILLING_CYCLE_1.'</option>
      			<option value="3"'.$selected[3].'>'.LANG_BILLING_CYCLE_3.'</option>
      			<option value="6"'.$selected[6].'>'.LANG_BILLING_CYCLE_6.'</option>
     			<option value="12"'.$selected[12].'>'.LANG_BILLING_CYCLE_12.'</option>
      			<option value="24"'.$selected[24].'>'.LANG_BILLING_CYCLE_24.'</option>
			</select>

                    </td>
                </tr>
                </table>';
    $tabs->endTab();
    $tabs->endPane();
    echo '
            </td>
        </tr>
        </table>
        <input type="hidden" name="option" value="'.$option.'" />
        <input type="hidden" name="id" value="'.$row->id.'" />
        <input type="hidden" name="ordering" value="'.$row->ordering.'" />
        <input type="hidden" name="task" value="savePlan" />
        </form>';
}
}

?>